/* 知识库管理页面样式 */
.knowledge-container {
    padding: 20px;
}

.knowledge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-bar {
    display: flex;
    width: 300px;
}

.search-input {
    flex: 1;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-button {
    padding: 8px 15px;
    background-color: #1a5fb4;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

.btn-primary {
    background-color: #1a5fb4;
    color: white;
}

.btn-secondary {
    background-color: #f0f2f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-outline {
    background-color: transparent;
    color: #1a5fb4;
    border: 1px solid #1a5fb4;
    padding: 5px 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.category-filter {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.filter-item {
    padding: 5px 15px;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 15px;
    font-size: 14px;
}

.filter-item:hover {
    background-color: #f0f7ff;
    color: #1a5fb4;
}

.filter-item.active {
    background-color: #e6f0ff;
    color: #1a5fb4;
    font-weight: bold;
}

.grid-container {
    display: grid;
    /* 修改: 使用 auto-fill 和 minmax 实现自适应列宽 */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.knowledge-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    /*min-height: 150px;*/
    height: 250px;
    width: 320px;
}

.knowledge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.knowledge-card h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.card-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 12px;
    margin-bottom: 15px;
}

.card-meta span {
    display: flex;
    align-items: center;
}

.card-meta i {
    margin-right: 5px;
}

.card-actions {
    display: flex;
    justify-content: space-between;
}

.add-new {
    background-color: #f9f9f9;
    border: 2px dashed #ddd;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.add-new .card-icon {
    margin: 0 auto 15px auto;
}

.add-new h3 {
    color: #666;
}

.add-new:hover {
    border-color: #1a5fb4;
    background-color: #f0f7ff;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.page-btn {
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
}

.page-btn:hover {
    background-color: #f0f2f5;
}

.page-btn.active {
    background-color: #1a5fb4;
    color: white;
    border-color: #1a5fb4;
}

.page-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 5px;
    margin: 0 5px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}



:root {
    --primary-color: #1976d2;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --light-text: #757575;
    --border-color: #e0e0e0;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--white);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--light-text);
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .knowledge-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar {
        min-width: 100%;
    }

    .action-buttons {
        justify-content: flex-end;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

